package com.nce.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.nce.entity.account.User;

/**
 *重点微博
 * 
 * @author GT
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "Mblog_VIP")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class MblogVip implements Serializable  {	
	/**
CREATE TABLE `Mblog_VIP` (
  `id` mediumint(9) NOT NULL auto_increment,#
  `Mblog_id` varchar(255) default NULL,#VIP的微博id，如，他的新浪id
  `uid` mediumint(9) default NULL,#VIP所属的用户id 
  `Mblog_name` varchar(255) default NULL,#VIP的微博名
  `action` varchar(255) default NULL,#文章范围（未启用，关键词命中，全部）
  `tm_modified` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, #创建/修改时间
  PRIMARY KEY  (`id`),
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
*/
	private static final long serialVersionUID = -430038188136037356L;
	private Long id;
	private String mblogId;
	private String mblogName;
	private String actionLevel;
	private Date tmModified;
	private User user;
	
	
	
	public String getMblogId() {
		return mblogId;
	}

	public void setMblogId(String mblogId) {
		this.mblogId = mblogId;
	}

	public String getMblogName() {
		return mblogName;
	}

	public void setMblogName(String mblogName) {
		this.mblogName = mblogName;
	}

	@Id
	@Column(name="id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	

	@Column(name="action")
	public String getActionLevel() {
		return actionLevel;
	}

	public void setActionLevel(String actionLevel) {
		this.actionLevel = actionLevel;
	}

	public Date getTmModified() {
		return tmModified;
	}

	public void setTmModified(Date tmModified) {
		this.tmModified = tmModified;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "uid")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}


}